package legumes.client.services.callbacks;

import java.util.List;

import legumes.client.services.LegumesServicesHelper;
import legumes.client.services.util.rpc.SequencableRPCCall;
import legumes.shared.domain.Product;

public class GetProductsCallback extends SequencableRPCCall<List<Product>> {

	private List<Product> products;

	@Override
	protected void doCall() {
		LegumesServicesHelper.LEGUMES_SERVICES.getProducts(this);
	}

	public void onSuccess(List<Product> products_) {
		products = products_;
		callNext();
	}

	public List<Product> getProducts() {
		return products;
	}

}